<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./dist/observertools.js"></script>
    <script src="./dist/test.js"></script>
    <link rel="stylesheet" href="./index.css">
    <style>
        #app {
            width: 300px;
            height: 300px;
            overflow-y: auto;
        }

        /* .other {
            display: flex;
            justify-content: flex-start;
            align-items: center;
        } */

        .img {
            width: 300px;
            height: 300px;
            color: #fff;
            text-align: center;
            line-height: 100px;
        }

        .observe-animation-diy {
            animation: diy 1s ease;
        }
        @keyframes diy{
            from {
                opacity: 0;
            }
            to{
                opacity: 1;
            }
        }
    </style>
</head>

<body>
    <div id="app">
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
        <!-- <div style="width: 100%;height: 40px;background: red;" class="touch">触底元素</div> -->
        <div>其他元素</div>
        <div>其他元素</div>
        <div>其他元素</div>
    </div>
    <script>
        // let observe = new observerTools("onBottom", document.querySelectorAll("#app"), null, function(res){
        //     // 触底回调 
        // });
        let observe = new observertools.default("onBottom", document.querySelectorAll("#app"), null, res => {
            alert("触底")
        });
    </script>
</body>

</html>